<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
    // 所有直接调用的方法, 构造函数, 属性, 都挂载在window对象上
    window.console
    window.setTimeout
    window.document

    // 所有自己直接写的属性方法都会挂载到window
    a = 5
    console.log(a)
    console.log(window.a)
    console.log(this.a)

    function hello() {
      console.log("hello")
    }

    console.log(window.hello)
  </script>
</body>
</html>
